package org.wiztools.commons.feed;

import com.sun.syndication.feed.synd.SyndEntry;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author subhash
 */
class RomeUtil {
    static final List<FeedEntry> getEntries(List<SyndEntry> romeEntries) throws MalformedURLException{
        List<FeedEntry> l = new ArrayList<FeedEntry>();
        for(SyndEntry romeEntry: romeEntries){
            FeedEntry entry = new FeedEntry();
            entry.setUrl(new URL(romeEntry.getLink()));
            entry.setTitle(romeEntry.getTitle());
            entry.setContent(romeEntry.getDescription().getValue());
            entry.setPublishedDate(romeEntry.getPublishedDate());
            entry.setUpdatedDate(romeEntry.getUpdatedDate());
            l.add(entry);
        }
        return l;
    }
}
